package com.creative.annotation;

import com.creative.core.domain.enums.VerifyRegexEnum;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.PARAMETER, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface VerifyParam {

    int max() default -1;
    int min() default -1;

    /**
     * 参数是否为必须项
     *
     * @return boolean
     * @author ling
     * @date 2024/11/23
     */
    boolean required() default false;

    /**
     * 正则表达式 默认不校验
     *
     * @return {@link VerifyRegexEnum }
     * @author ling
     * @date 2024/11/23
     */
    VerifyRegexEnum regex() default VerifyRegexEnum.NO;

}
